<?php

function hj_framework_industry_list() {
    return $industries = array(
        "industry:47" => elgg_echo("Accounting"),
        "industry:94" => elgg_echo("Airlines/Aviation"),
        "industry:120" => elgg_echo("AlternativeDisputeResolution"),
        "industry:125" => elgg_echo("AlternativeMedicine"),
        "industry:127" => elgg_echo("Animation"),
        "industry:19" => elgg_echo("Apparel&Fashion"),
        "industry:50" => elgg_echo("Architecture&Planning"),
        "industry:111" => elgg_echo("ArtsandCrafts"),
        "industry:53" => elgg_echo("Automotive"),
        "industry:52" => elgg_echo("Aviation&Aerospace"),
        "industry:41" => elgg_echo("Banking"),
        "industry:12" => elgg_echo("Biotechnology"),
        "industry:36" => elgg_echo("BroadcastMedia"),
        "industry:49" => elgg_echo("BuildingMaterials"),
        "industry:138" => elgg_echo("BusinessSuppliesandEquipment"),
        "industry:129" => elgg_echo("CapitalMarkets"),
        "industry:54" => elgg_echo("Chemicals"),
        "industry:90" => elgg_echo("Civic&SocialOrganization"),
        "industry:51" => elgg_echo("CivilEngineering"),
        "industry:128" => elgg_echo("CommercialRealEstate"),
        "industry:118" => elgg_echo("Computer&NetworkSecurity"),
        "industry:109" => elgg_echo("ComputerGames"),
        "industry:3" => elgg_echo("ComputerHardware"),
        "industry:5" => elgg_echo("ComputerNetworking"),
        "industry:4" => elgg_echo("ComputerSoftware"),
        "industry:48" => elgg_echo("Construction"),
        "industry:24" => elgg_echo("ConsumerElectronics"),
        "industry:25" => elgg_echo("ConsumerGoods"),
        "industry:91" => elgg_echo("ConsumerServices"),
        "industry:18" => elgg_echo("Cosmetics"),
        "industry:65" => elgg_echo("Dairy"),
        "industry:1" => elgg_echo("Defense&Space"),
        "industry:99" => elgg_echo("Design"),
        "industry:69" => elgg_echo("EducationManagement"),
        "industry:132" => elgg_echo("E-Learning"),
        "industry:112" => elgg_echo("Electrical/ElectronicManufacturing"),
        "industry:28" => elgg_echo("Entertainment"),
        "industry:86" => elgg_echo("EnvironmentalServices"),
        "industry:110" => elgg_echo("EventsServices"),
        "industry:76" => elgg_echo("ExecutiveOffice"),
        "industry:122" => elgg_echo("FacilitiesServices"),
        "industry:63" => elgg_echo("Farming"),
        "industry:43" => elgg_echo("FinancialServices"),
        "industry:38" => elgg_echo("FineArt"),
        "industry:66" => elgg_echo("Fishery"),
        "industry:34" => elgg_echo("Food&Beverages"),
        "industry:23" => elgg_echo("FoodProduction"),
        "industry:101" => elgg_echo("Fund-Raising"),
        "industry:26" => elgg_echo("Furniture"),
        "industry:29" => elgg_echo("Gambling&Casinos"),
        "industry:145" => elgg_echo("Glass,Ceramics&Concrete"),
        "industry:75" => elgg_echo("GovernmentAdministration"),
        "industry:148" => elgg_echo("GovernmentRelations"),
        "industry:140" => elgg_echo("GraphicDesign"),
        "industry:124" => elgg_echo("Health,WellnessandFitness"),
        "industry:68" => elgg_echo("HigherEducation"),
        "industry:14" => elgg_echo("Hospital&HealthCare"),
        "industry:31" => elgg_echo("Hospitality"),
        "industry:137" => elgg_echo("HumanResources"),
        "industry:134" => elgg_echo("ImportandExport"),
        "industry:88" => elgg_echo("Individual&FamilyServices"),
        "industry:147" => elgg_echo("IndustrialAutomation"),
        "industry:84" => elgg_echo("InformationServices"),
        "industry:96" => elgg_echo("InformationTechnologyandServices"),
        "industry:42" => elgg_echo("Insurance"),
        "industry:74" => elgg_echo("InternationalAffairs"),
        "industry:141" => elgg_echo("InternationalTradeandDevelopment"),
        "industry:6" => elgg_echo("Internet"),
        "industry:45" => elgg_echo("InvestmentBanking"),
        "industry:46" => elgg_echo("InvestmentManagement"),
        "industry:73" => elgg_echo("Judiciary"),
        "industry:77" => elgg_echo("LawEnforcement"),
        "industry:9" => elgg_echo("LawPractice"),
        "industry:10" => elgg_echo("LegalServices"),
        "industry:72" => elgg_echo("LegislativeOffice"),
        "industry:30" => elgg_echo("Leisure,Travel&Tourism"),
        "industry:85" => elgg_echo("Libraries"),
        "industry:116" => elgg_echo("LogisticsandSupplyChain"),
        "industry:143" => elgg_echo("LuxuryGoods&Jewelry"),
        "industry:55" => elgg_echo("Machinery"),
        "industry:11" => elgg_echo("ManagementConsulting"),
        "industry:95" => elgg_echo("Maritime"),
        "industry:97" => elgg_echo("MarketResearch"),
        "industry:80" => elgg_echo("MarketingandAdvertising"),
        "industry:135" => elgg_echo("MechanicalorIndustrialEngineering"),
        "industry:126" => elgg_echo("MediaProduction"),
        "industry:17" => elgg_echo("MedicalDevices"),
        "industry:13" => elgg_echo("MedicalPractice"),
        "industry:139" => elgg_echo("MentalHealthCare"),
        "industry:71" => elgg_echo("Military"),
        "industry:56" => elgg_echo("Mining&Metals"),
        "industry:35" => elgg_echo("MotionPicturesandFilm"),
        "industry:37" => elgg_echo("MuseumsandInstitutions"),
        "industry:115" => elgg_echo("Music"),
        "industry:114" => elgg_echo("Nanotechnology"),
        "industry:81" => elgg_echo("Newspapers"),
        "industry:100" => elgg_echo("Non-ProfitOrganizationManagement"),
        "industry:57" => elgg_echo("Oil&Energy"),
        "industry:113" => elgg_echo("OnlineMedia"),
        "industry:123" => elgg_echo("Outsourcing/Offshoring"),
        "industry:87" => elgg_echo("Package/FreightDelivery"),
        "industry:146" => elgg_echo("PackagingandContainers"),
        "industry:61" => elgg_echo("Paper&ForestProducts"),
        "industry:39" => elgg_echo("PerformingArts"),
        "industry:15" => elgg_echo("Pharmaceuticals"),
        "industry:131" => elgg_echo("Philanthropy"),
        "industry:136" => elgg_echo("Photography"),
        "industry:117" => elgg_echo("Plastics"),
        "industry:107" => elgg_echo("PoliticalOrganization"),
        "industry:67" => elgg_echo("Primary/SecondaryEducation"),
        "industry:83" => elgg_echo("Printing"),
        "industry:105" => elgg_echo("ProfessionalTraining&Coaching"),
        "industry:102" => elgg_echo("ProgramDevelopment"),
        "industry:79" => elgg_echo("PublicPolicy"),
        "industry:98" => elgg_echo("PublicRelationsandCommunications"),
        "industry:78" => elgg_echo("PublicSafety"),
        "industry:82" => elgg_echo("Publishing"),
        "industry:62" => elgg_echo("RailroadManufacture"),
        "industry:64" => elgg_echo("Ranching"),
        "industry:44" => elgg_echo("RealEstate"),
        "industry:40" => elgg_echo("RecreationalFacilitiesandServices"),
        "industry:89" => elgg_echo("ReligiousInstitutions"),
        "industry:144" => elgg_echo("Renewables&Environment"),
        "industry:70" => elgg_echo("Research"),
        "industry:32" => elgg_echo("Restaurants"),
        "industry:27" => elgg_echo("Retail"),
        "industry:121" => elgg_echo("SecurityandInvestigations"),
        "industry:7" => elgg_echo("Semiconductors"),
        "industry:58" => elgg_echo("Shipbuilding"),
        "industry:20" => elgg_echo("SportingGoods"),
        "industry:33" => elgg_echo("Sports"),
        "industry:104" => elgg_echo("StaffingandRecruiting"),
        "industry:22" => elgg_echo("Supermarkets"),
        "industry:8" => elgg_echo("Telecommunications"),
        "industry:60" => elgg_echo("Textiles"),
        "industry:130" => elgg_echo("ThinkTanks"),
        "industry:21" => elgg_echo("Tobacco"),
        "industry:108" => elgg_echo("TranslationandLocalization"),
        "industry:92" => elgg_echo("Transportation/Trucking/Railroad"),
        "industry:59" => elgg_echo("Utilities"),
        "industry:106" => elgg_echo("VentureCapital&PrivateEquity"),
        "industry:16" => elgg_echo("Veterinary"),
        "industry:93" => elgg_echo("Warehousing"),
        "industry:133" => elgg_echo("Wholesale"),
        "industry:142" => elgg_echo("WineandSpirits"),
        "industry:119" => elgg_echo("Wireless"),
        "industry:103" => elgg_echo("WritingandEditing")
    );
}

function hj_framework_country_codes($countryCode = NULL) {

    $countryNames = array(
        "ad" => "Andorra",
        "ae" => "United Arab Emirates",
        "af" => "Afghanistan",
        "ag" => "Antigua and Barbuda",
        "ai" => "Anguilla",
        "al" => "Albania",
        "am" => "Armenia",
        "an" => "Netherlands Antilles",
        "ao" => "Angola",
        "aq" => "Antarctica",
        "ar" => "Argentina",
        "as" => "American Samoa",
        "at" => "Austria",
        "au" => "Australia",
        "aw" => "Aruba",
        "ax" => "Aland Islands",
        "az" => "Azerbaijan",
        "ba" => "Bosnia and Herzegovina",
        "bb" => "Barbados",
        "bd" => "Bangladesh",
        "be" => "Belgium",
        "bf" => "Burkina Faso",
        "bg" => "Bulgaria",
        "bh" => "Bahrain",
        "bi" => "Burundi",
        "bj" => "Benin",
        "bm" => "Bermuda",
        "bn" => "Brunei Darussalam",
        "bo" => "Bolivia",
        "br" => "Brazil",
        "bs" => "Bahamas",
        "bt" => "Bhutan",
        "bv" => "Bouvet Island",
        "bw" => "Botswana",
        "by" => "Belarus",
        "bz" => "Belize",
        "ca" => "Canada",
        "cb" => "Caribbean Nations",
        "cc" => "Cocos (Keeling) Islands",
        "cd" => "Democratic Republic of the Congo",
        "cf" => "Central African Republic",
        "cg" => "Congo",
        "ch" => "Switzerland",
        "ci" => "Cote D'Ivoire (Ivory Coast)",
        "ck" => "Cook Islands",
        "cl" => "Chile",
        "cm" => "Cameroon",
        "cn" => "China",
        "co" => "Colombia",
        "cr" => "Costa Rica",
        "cs" => "Serbia and Montenegro",
        "cu" => "Cuba",
        "cv" => "Cape Verde",
        "cx" => "Christmas Island",
        "cy" => "Cyprus",
        "cz" => "Czech Republic",
        "de" => "Germany",
        "dj" => "Djibouti",
        "dk" => "Denmark",
        "dm" => "Dominica",
        "do" => "Dominican Republic",
        "dz" => "Algeria",
        "ec" => "Ecuador",
        "ee" => "Estonia",
        "eg" => "Egypt",
        "eh" => "Western Sahara",
        "er" => "Eritrea",
        "es" => "Spain",
        "et" => "Ethiopia",
        "fi" => "Finland",
        "fj" => "Fiji",
        "fk" => "Falkland Islands (Malvinas)",
        "fm" => "Federated States of Micronesia",
        "fo" => "Faroe Islands",
        "fr" => "France",
        "fx" => "France, Metropolitan",
        "ga" => "Gabon",
        "gb" => "United Kingdom",
        "gd" => "Grenada",
        "ge" => "Georgia",
        "gf" => "French Guiana",
        "gh" => "Ghana",
        "gi" => "Gibraltar",
        "gl" => "Greenland",
        "gm" => "Gambia",
        "gn" => "Guinea",
        "gp" => "Guadeloupe",
        "gq" => "Equatorial Guinea",
        "gr" => "Greece",
        "gs" => "S. Georgia and S. Sandwich Islands",
        "gt" => "Guatemala",
        "gu" => "Guam",
        "gw" => "Guinea-Bissau",
        "gy" => "Guyana",
        "hk" => "Hong Kong",
        "hm" => "Heard Island and McDonald Islands",
        "hn" => "Honduras",
        "hr" => "Croatia",
        "ht" => "Haiti",
        "hu" => "Hungary",
        "id" => "Indonesia",
        "ie" => "Ireland",
        "il" => "Israel",
        "in" => "India",
        "io" => "British Indian Ocean Territory",
        "iq" => "Iraq",
        "ir" => "Iran",
        "is" => "Iceland",
        "it" => "Italy",
        "jm" => "Jamaica",
        "jo" => "Jordan",
        "jp" => "Japan",
        "ke" => "Kenya",
        "kg" => "Kyrgyzstan",
        "kh" => "Cambodia",
        "ki" => "Kiribati",
        "km" => "Comoros",
        "kn" => "Saint Kitts and Nevis",
        "kp" => "Korea (North)",
        "kr" => "Korea",
        "kw" => "Kuwait",
        "ky" => "Cayman Islands",
        "kz" => "Kazakhstan",
        "la" => "Laos",
        "lb" => "Lebanon",
        "lc" => "Saint Lucia",
        "li" => "Liechtenstein",
        "lk" => "Sri Lanka",
        "lr" => "Liberia",
        "ls" => "Lesotho",
        "lt" => "Lithuania",
        "lu" => "Luxembourg",
        "lv" => "Latvia",
        "ly" => "Libya",
        "ma" => "Morocco",
        "mc" => "Monaco",
        "md" => "Moldova",
        "mg" => "Madagascar",
        "mh" => "Marshall Islands",
        "mk" => "Macedonia",
        "ml" => "Mali",
        "mm" => "Myanmar",
        "mn" => "Mongolia",
        "mo" => "Macao",
        "mp" => "Northern Mariana Islands",
        "mq" => "Martinique",
        "mr" => "Mauritania",
        "ms" => "Montserrat",
        "mt" => "Malta",
        "mu" => "Mauritius",
        "mv" => "Maldives",
        "mw" => "Malawi",
        "mx" => "Mexico",
        "my" => "Malaysia",
        "mz" => "Mozambique",
        "na" => "Namibia",
        "nc" => "New Caledonia",
        "ne" => "Niger",
        "nf" => "Norfolk Island",
        "ng" => "Nigeria",
        "ni" => "Nicaragua",
        "nl" => "Netherlands",
        "no" => "Norway",
        "np" => "Nepal",
        "nr" => "Nauru",
        "nu" => "Niue",
        "nz" => "New Zealand",
        "om" => "Sultanate of Oman",
        "oo" => "Other",
        "pa" => "Panama",
        "pe" => "Peru",
        "pf" => "French Polynesia",
        "pg" => "Papua New Guinea",
        "ph" => "Philippines",
        "pk" => "Pakistan",
        "pl" => "Poland",
        "pm" => "Saint Pierre and Miquelon",
        "pn" => "Pitcairn",
        "pr" => "Puerto Rico",
        "ps" => "Palestinian Territory",
        "pt" => "Portugal",
        "pw" => "Palau",
        "py" => "Paraguay",
        "qa" => "Qatar",
        "re" => "Reunion",
        "ro" => "Romania",
        "ru" => "Russian Federation",
        "rw" => "Rwanda",
        "sa" => "Saudi Arabia",
        "sb" => "Solomon Islands",
        "sc" => "Seychelles",
        "sd" => "Sudan",
        "se" => "Sweden",
        "sg" => "Singapore",
        "sh" => "Saint Helena",
        "si" => "Slovenia",
        "sj" => "Svalbard and Jan Mayen",
        "sk" => "Slovak Republic",
        "sl" => "Sierra Leone",
        "sm" => "San Marino",
        "sn" => "Senegal",
        "so" => "Somalia",
        "sr" => "Suriname",
        "st" => "Sao Tome and Principe",
        "sv" => "El Salvador",
        "sy" => "Syria",
        "sz" => "Swaziland",
        "tc" => "Turks and Caicos Islands",
        "td" => "Chad",
        "tf" => "French Southern Territories",
        "tg" => "Togo",
        "th" => "Thailand",
        "tj" => "Tajikistan",
        "tk" => "Tokelau",
        "tl" => "Timor-Leste",
        "tm" => "Turkmenistan",
        "tn" => "Tunisia",
        "to" => "Tonga",
        "tp" => "East Timor",
        "tr" => "Turkey",
        "tt" => "Trinidad and Tobago",
        "tv" => "Tuvalu",
        "tw" => "Taiwan",
        "tz" => "Tanzania",
        "ua" => "Ukraine",
        "ug" => "Uganda",
        "us" => "United States",
        "uy" => "Uruguay",
        "uz" => "Uzbekistan",
        "va" => "Vatican City State (Holy See)",
        "vc" => "Saint Vincent and the Grenadines",
        "ve" => "Venezuela",
        "vg" => "Virgin Islands (British)",
        "vi" => "Virgin Islands (U.S.)",
        "vn" => "Viet Nam",
        "vu" => "Vanuatu",
        "wf" => "Wallis and Futuna",
        "ws" => "Samoa",
        "ye" => "Yemen",
        "yt" => "Mayotte",
        "yu" => "Yugoslavia",
        "za" => "South Africa",
        "zm" => "Zambia",
        "zw" => "Zimbabwe",
    );

    if ($countryCode) {
        return $countryNames[$countryCode];
    } else {
        return $countryNames;
    }
}

function hj_framework_get_country_list() {
    $countries = hj_framework_country_codes();
    foreach ($countries as $code => $name) {
        $return[$name] = $name;
    }
    return $return;
}

function hj_framework_mime_mapping() {
    return $mapping = array(
        'application/excel' => 'xls',
        'application/msword' => 'doc',
        'application/pdf' => 'pdf',
        'application/powerpoint' => 'ppt',
        'application/vnd.ms-excel' => 'xls',
        'application/vnd.ms-powerpoint' => 'ppt',
        'application/vnd.oasis.opendocument.text' => 'doc',
        'application/x-gzip' => 'gzip',
        'application/x-rar-compressed' => 'rar',
        'application/zip' => 'zip',
        'text/directory' => 'vcard',
        'text/v-card' => 'vcard',
        'application/octet-stream' => 'exe',
        'application' => 'application',
        'audio' => 'music',
        'text' => 'text',
        'video' => 'video',
        'image' => 'image'
    );
}